Calculate size based on the _child_ of the menu item, not the menuitem.
authorOwen Taylor <otaylor@redhat.com>
Mon, 26 Nov 2001 00:19:31 +0000 (00:19 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Mon, 26 Nov 2001 00:19:31 +0000 (00:19 +0000)
Sun Nov 25 18:59:19 2001  Owen Taylor  <otaylor@redhat.com>
* gtk/gtkoptionmenu.c (gtk_option_menu_calc_size):
Calculate size based on the _child_ of the menu item,
not the menuitem. (#65005, Damon Chaplin)
* gtk/gtklistitem.c (gtk_list_item_new_with_label): Add
some extra vertical padding to the label widget ... restores
GTK+-1.2 spacing. (#65085, Damon Chaplin.)

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtklistitem.c
gtk/gtkoptionmenu.c

index c69192c509939bc9e84d6c13799b770f70f14fe0..c62dd7a1fc0821ef3abea57d5a99d7a27b3360b2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+Sun Nov 25 18:59:19 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkoptionmenu.c (gtk_option_menu_calc_size): 
+       Calculate size based on the _child_ of the menu item,
+       not the menuitem. (#65005, Damon Chaplin)
+
+       * gtk/gtklistitem.c (gtk_list_item_new_with_label): Add
+       some extra vertical padding to the label widget ... restores
+       GTK+-1.2 spacing. (#65085, Damon Chaplin.)
+
 2001-11-26  Tor Lillqvist  <tml@iki.fi>
 
        * demos/pixbuf-demo.c
index c69192c509939bc9e84d6c13799b770f70f14fe0..c62dd7a1fc0821ef3abea57d5a99d7a27b3360b2 100644 (file)
@@ -1,3 +1,13 @@
+Sun Nov 25 18:59:19 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkoptionmenu.c (gtk_option_menu_calc_size): 
+       Calculate size based on the _child_ of the menu item,
+       not the menuitem. (#65005, Damon Chaplin)
+
+       * gtk/gtklistitem.c (gtk_list_item_new_with_label): Add
+       some extra vertical padding to the label widget ... restores
+       GTK+-1.2 spacing. (#65085, Damon Chaplin.)
+
 2001-11-26  Tor Lillqvist  <tml@iki.fi>
 
        * demos/pixbuf-demo.c
index c69192c509939bc9e84d6c13799b770f70f14fe0..c62dd7a1fc0821ef3abea57d5a99d7a27b3360b2 100644 (file)
@@ -1,3 +1,13 @@
+Sun Nov 25 18:59:19 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkoptionmenu.c (gtk_option_menu_calc_size): 
+       Calculate size based on the _child_ of the menu item,
+       not the menuitem. (#65005, Damon Chaplin)
+
+       * gtk/gtklistitem.c (gtk_list_item_new_with_label): Add
+       some extra vertical padding to the label widget ... restores
+       GTK+-1.2 spacing. (#65085, Damon Chaplin.)
+
 2001-11-26  Tor Lillqvist  <tml@iki.fi>
 
        * demos/pixbuf-demo.c
index c69192c509939bc9e84d6c13799b770f70f14fe0..c62dd7a1fc0821ef3abea57d5a99d7a27b3360b2 100644 (file)
@@ -1,3 +1,13 @@
+Sun Nov 25 18:59:19 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkoptionmenu.c (gtk_option_menu_calc_size): 
+       Calculate size based on the _child_ of the menu item,
+       not the menuitem. (#65005, Damon Chaplin)
+
+       * gtk/gtklistitem.c (gtk_list_item_new_with_label): Add
+       some extra vertical padding to the label widget ... restores
+       GTK+-1.2 spacing. (#65085, Damon Chaplin.)
+
 2001-11-26  Tor Lillqvist  <tml@iki.fi>
 
        * demos/pixbuf-demo.c
index c69192c509939bc9e84d6c13799b770f70f14fe0..c62dd7a1fc0821ef3abea57d5a99d7a27b3360b2 100644 (file)
@@ -1,3 +1,13 @@
+Sun Nov 25 18:59:19 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkoptionmenu.c (gtk_option_menu_calc_size): 
+       Calculate size based on the _child_ of the menu item,
+       not the menuitem. (#65005, Damon Chaplin)
+
+       * gtk/gtklistitem.c (gtk_list_item_new_with_label): Add
+       some extra vertical padding to the label widget ... restores
+       GTK+-1.2 spacing. (#65085, Damon Chaplin.)
+
 2001-11-26  Tor Lillqvist  <tml@iki.fi>
 
        * demos/pixbuf-demo.c
index c69192c509939bc9e84d6c13799b770f70f14fe0..c62dd7a1fc0821ef3abea57d5a99d7a27b3360b2 100644 (file)
@@ -1,3 +1,13 @@
+Sun Nov 25 18:59:19 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkoptionmenu.c (gtk_option_menu_calc_size): 
+       Calculate size based on the _child_ of the menu item,
+       not the menuitem. (#65005, Damon Chaplin)
+
+       * gtk/gtklistitem.c (gtk_list_item_new_with_label): Add
+       some extra vertical padding to the label widget ... restores
+       GTK+-1.2 spacing. (#65085, Damon Chaplin.)
+
 2001-11-26  Tor Lillqvist  <tml@iki.fi>
 
        * demos/pixbuf-demo.c
index c69192c509939bc9e84d6c13799b770f70f14fe0..c62dd7a1fc0821ef3abea57d5a99d7a27b3360b2 100644 (file)
@@ -1,3 +1,13 @@
+Sun Nov 25 18:59:19 2001  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkoptionmenu.c (gtk_option_menu_calc_size): 
+       Calculate size based on the _child_ of the menu item,
+       not the menuitem. (#65005, Damon Chaplin)
+
+       * gtk/gtklistitem.c (gtk_list_item_new_with_label): Add
+       some extra vertical padding to the label widget ... restores
+       GTK+-1.2 spacing. (#65085, Damon Chaplin.)
+
 2001-11-26  Tor Lillqvist  <tml@iki.fi>
 
        * demos/pixbuf-demo.c
index d6f7a1d40bdd1aa05e6abf3744182c980e4b6094..996fb618e616a984c0ab35a6b43b325ca7a693f6 100644 (file)
@@ -390,7 +390,8 @@ gtk_list_item_new_with_label (const gchar *label)
   list_item = gtk_list_item_new ();
   label_widget = gtk_label_new (label);
   gtk_misc_set_alignment (GTK_MISC (label_widget), 0.0, 0.5);
-
+  gtk_misc_set_padding (GTK_MISC (label_widget), 0, 1);
+  
   gtk_container_add (GTK_CONTAINER (list_item), label_widget);
   gtk_widget_show (label_widget);
 
index 8e7856ce7057ddbc8401c51eedffb1d3d05a58d1..458a8fe4311af36b2d130e82074a4a2d6204603f 100644 (file)
@@ -848,10 +848,15 @@ gtk_option_menu_calc_size (GtkOptionMenu *option_menu)
 
          if (GTK_WIDGET_VISIBLE (child))
            {
-             gtk_widget_size_request (child, &child_requisition);
+             GtkWidget *inner = GTK_BIN (child)->child;
 
-             option_menu->width = MAX (option_menu->width, child_requisition.width);
-             option_menu->height = MAX (option_menu->height, child_requisition.height);
+             if (inner)
+               {
+                 gtk_widget_size_request (inner, &child_requisition);
+
+                 option_menu->width = MAX (option_menu->width, child_requisition.width);
+                 option_menu->height = MAX (option_menu->height, child_requisition.height);
+               }
            }
        }
     }